//
//  YBOneClickLoginVC.swift
//  Moonlight
//
//  Created by Penlon Kim on 2024/1/1.
//  Copyright © 2024 Moonlight Game Streaming Project. All rights reserved.
//

import UIKit
import SnapKit
import SwiftyJSON
import SVProgressHUD
import EachNavigationBar
import SwifterSwift

class YBOneClickLoginVC: BaseVC {
    
    // MARK: Lifecycle
    override func viewDidLoad() {
        super.viewDidLoad()
        
        navigation.bar.alpha = 0
        view.backgroundColor = .lightWhiteDark27
        view.addSubview(oneClickLoginView)
        
        oneClickLoginView.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
        
    }
    
    override func viewWillAppear(_ animated: Bool) {
        super.viewWillAppear(animated)
        self.bk_setBackBarButtonItem(isHidden: true)
    }
    
    // MARK: - lazy
    lazy var vm: YBLoginViewModel = {
        let vm = YBLoginViewModel()
        return vm
    }()
    
    private lazy var oneClickLoginView: YBOneClickLoginView = {
        let view = YBOneClickLoginView()
        view.delegate = self
        return view
    }()
    
}

// MARK: - YBOneClickLoginViewDelegate代理
extension YBOneClickLoginVC: YBOneClickLoginViewDelegate {
    
    func oneClickLoginViewDidClick(_ btnType: YBOneClickLoginView.BtnType) {
        switch btnType {
        case .oneClickLogin:
            break
        case .register:
            let vc = YBRegisterVC()
            self.navigationController?.pushViewController(vc)
        case .phonePwdLogin:
            self.navigationController?.popViewController()
        }
    }
    
}

// MARK: - 网络请求
extension YBOneClickLoginVC {
    
    
    
}
